
package com.ruoyi.web.controller.lingshui.integrityInformation;


import java.util.List;

import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.supervise.domain.HnCityBad;
import com.ruoyi.supervise.domain.HnCityGood;
import com.ruoyi.supervise.domain.IGMCompanyPoorInfo;
import com.ruoyi.supervise.domain.IGMCompanyWellInfo;
import com.ruoyi.supervise.service.IIntegrityInformationService;

/**
 * @ClassName: enterprisesBehaviorController
 * @Description: 诚信信息管理中企业行为的controller
 * @Author wtj
 * @DateTime 2020年5月12日 下午3:29:59
 */
@Controller
@RequestMapping("/integrityInformation/enterprisesBehavior")
public class enterprisesBehaviorController extends BaseController{

	private String goodBehaviorPrefix = "lingshui/integrityInformation/enterprisesGoodBehavior";
	private String badBehaviorPrefix = "lingshui/integrityInformation/enterprisesBadBehavior";
	
	@Autowired
    private IIntegrityInformationService integrityInformationService;
	
	/**
	 * @Title: enterprisesGood
	 * @Description: 跳转到企业良好行为记录页面
	 * @Author wtj
	 * @DateTime 2020-9-27 14:24:01
	 * @return
	 */
	@RequiresPermissions("integrityInformation:enterprisesGoodBehavior:view")
	@GetMapping("/enterprisesGood")
	public String enterprisesGood()
	{
	    return goodBehaviorPrefix + "/enterprisesGoodBehavior";
	}
	
	/**
	 * @Title: enterprisesGoodList
	 * @Description: 企业良好行为记录页面获取列表数据
	 * @Author wtj
	 * @DateTime 2020-9-27 14:25:23
	 * @param igmcwi
	 * @return
	 */
	@RequiresPermissions("integrityInformation:enterprisesGoodBehavior:list")
	@PostMapping("/enterprisesGoodList")
    @ResponseBody
    public TableDataInfo enterprisesGoodList(IGMCompanyWellInfo igmcwi)
    {
	   startPage();
	   List<IGMCompanyWellInfo> igmcwiList = integrityInformationService.selectIGMCompanyWellInfoList(igmcwi);
	   return getDataTable(igmcwiList);
    }
	
	/**
	 * @Title: enterprisesGoodDetail
	 * @Description: 企业良好行为详情
	 * @Author wtj
	 * @DateTime 2020-9-27 14:26:48
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformation:enterprisesGoodBehavior:detail")
	@GetMapping("/enterprisesGoodDetail/{guid}")
    public String enterprisesGoodDetail(@PathVariable("guid") String guid,ModelMap mmap)
    {
	   IGMCompanyWellInfo igmcwi = integrityInformationService.selectIGMCompanyWellInfoByGuid(guid);
	   mmap.put("igmcwi", igmcwi);
	   return goodBehaviorPrefix + "/lianghaojilu";
    }
	
	/**
	 * @Title: enterprisesGoodExport
	 * @Description: 企业良好行为导出
	 * @Author wtj
	 * @DateTime 2020-9-27 14:27:17
	 * @return
	 */
	@RequiresPermissions("integrityInformation:enterprisesGoodBehavior:export")
	@PostMapping("/enterprisesGoodExport")
    @ResponseBody
    public AjaxResult enterprisesGoodExport()
    {
		List<HnCityGood> hncg = integrityInformationService.statisticsCompanyWellInfo();
		ExcelUtil<HnCityGood> util = new ExcelUtil<HnCityGood>(HnCityGood.class);
        return util.exportExcel(hncg, "企业良好行为");
    }
	
	/**
	 * @Title: enterprisesBad
	 * @Description: 跳转到企业不良行为记录页面
	 * @Author wtj
	 * @DateTime 2020-9-27 14:30:33
	 * @return
	 */
	@RequiresPermissions("integrityInformation:enterprisesBadBehavior:view")
	@GetMapping("/enterprisesBad")
	public String enterprisesBad()
	{
	    return badBehaviorPrefix + "/enterprisesBadBehavior";
	}
	
	/**
	 * @Title: enterprisesBadList
	 * @Description: 企业不良行为记录页面获取列表数据
	 * @Author wtj
	 * @DateTime 2020-9-27 14:31:22
	 * @param igmcpi
	 * @return
	 */
	@RequiresPermissions("integrityInformation:enterprisesBadBehavior:list")
	@PostMapping("/enterprisesBadList")
    @ResponseBody
    public TableDataInfo enterprisesBadList(IGMCompanyPoorInfo igmcpi)
    {
	   startPage();
	   List<IGMCompanyPoorInfo> igmcpiList = integrityInformationService.selectIGMCompanyPoorInfoList(igmcpi);
	   return getDataTable(igmcpiList);
    }
	
	/**
	 * @Title: enterprisesBadDetail
	 * @Description: 企业不良行为详情
	 * @Author X1 Yoga
	 * @DateTime 2020-9-27 14:32:00
	 * @param guid
	 * @param mmap
	 * @return
	 */
	@RequiresPermissions("integrityInformation:enterprisesBadBehavior:detail")
	@GetMapping("/enterprisesBadDetail/{guid}")
    public String enterprisesBadDetail(@PathVariable("guid") String guid,ModelMap mmap)
    {
		IGMCompanyPoorInfo igmcpi = integrityInformationService.selectIGMCompanyPoorInfoByGuid(guid);
	   mmap.put("igmcpi", igmcpi);
	   return badBehaviorPrefix + "/buliangjilu";
    }
	
	/**
	 * @Title: enterprisesBadExport
	 * @Description: 企业不良行为导出
	 * @Author wtj
	 * @DateTime 2020-9-27 14:32:30
	 * @return
	 */
	@RequiresPermissions("integrityInformation:enterprisesBadBehavior:export")
	@PostMapping("/enterprisesBadExport")
    @ResponseBody
    public AjaxResult enterprisesBadExport()
    {
		List<HnCityBad> hncb = integrityInformationService.statisticsCompanyPoorInfo();
		ExcelUtil<HnCityBad> util = new ExcelUtil<HnCityBad>(HnCityBad.class);
        return util.exportExcel(hncb, "企业不良行为");
    }
	
}
